package com.example.WeiNi.cyy;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Intellij IDEA
 * Project: WeiNi
 * Author: magic_chen_
 * Email: 196607376@qq.com
 * Date: 2015/6/15
 */
public class FragmentsAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    public FragmentsAdapter(FragmentManager fm,List<Fragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment ret = null;
        if (fragmentList != null) {
            ret = fragmentList.get(position);
        }
        return ret;
    }

    @Override
    public int getCount() {
        int ret = 0;
        if (fragmentList != null) {
            ret = fragmentList.size();
        }
        return ret;
    }
}
